package com.mall.action;

import com.github.pagehelper.PageInfo;
import com.mall.bean.Address;
import com.mall.bean.Fadeback;
import com.mall.service.AddressService;
import com.mall.uitl.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/addressController")
public class AddressController {

    @Autowired
    AddressService addressService;

    @RequestMapping("/queryAddress")
    public JsonUtil queryAddress(Address address, Integer currentPage){
        PageInfo<Address> pageInfo =  addressService.queryDataByPage(currentPage,5,address);

        JsonUtil jsonUtil = new JsonUtil();
        jsonUtil.setData(pageInfo);

        return jsonUtil;
    }

}
